package com.hackerrank.challenges.manasaandstones;

import java.util.Iterator;
import java.util.Scanner;
import java.util.TreeSet;

public class Solution {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		for(int t = 0; t < T; t++) {
			int n = in.nextInt(), a = in.nextInt(), b = in.nextInt();
			TreeSet<Integer> ts = new TreeSet<Integer>();
			ts.add(0);
			for(int i = 1; i < n; i++) {
				Iterator<Integer> it = ts.iterator();
				TreeSet<Integer> ts2 = new TreeSet<Integer>();
				while(it.hasNext()) {
					int num = it.next();
					ts2.add(num + a);
					ts2.add(num + b);
				}
				ts = ts2;
			}
			Iterator<Integer> it = ts.iterator();
			while(it.hasNext())
				System.out.print(it.next() + " ");
			System.out.println();
		}
	}
}
